Skip to content

Allow sudoed admins higher decimal precision#370

Open
crthpl wants to merge 4 commits intomainfrom
worktree-admin-decimal-precision
Open

Allow sudoed admins higher decimal precision#370
crthpl wants to merge 4 commits intomainfrom
worktree-admin-decimal-precision

Conversation

@crthpl
Copy link
Copy Markdown
Contributor

@crthpl crthpl commented Mar 8, 2026

Summary

  • Sudoed admins can now use 2 decimal places for settlement values (create market min/max, settle market price) — up from 1 decimal for regular users
  • Sudoed admins can now use 4 decimal places for order prices and sizes — up from 1 decimal for regular users
  • Backend validation dynamically adjusts scale limits based on sudo status; frontend input controls (step, rounding, validation) adapt reactively

Test plan

  • cargo test-all — all tests pass
  • cargo clippy — clean
  • pnpm run check — clean
  • Manual: log in as admin, enable sudo, verify settlement forms allow 0.01 step
  • Manual: log in as admin, enable sudo, verify order entry allows 4 decimal places
  • Manual: log in as non-admin, verify 1 decimal place restrictions remain

Sudoed admins can now use:
- 2 decimal places for settlement values (create market min/max, settle price)
- 4 decimal places for order prices and sizes

Regular users retain 1 decimal place (frontend) / 2 decimal places (backend).
@crthpl crthpl requested a review from a team as a code owner March 8, 2026 13:24
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
platform Ready Ready Preview, Comment Mar 8, 2026 2:13pm

Request Review

create_order now dynamically picks precision (4 for sudo, 2 otherwise)
based on the client's tracked sudo_enabled state.
Reverts order precision changes (orders stay at 1 decimal frontend /
2 decimal backend). Instead, sudoed admins now get 4 decimal places
for transfer amounts (backend already allowed this; frontend now
adapts step and rounding when sudo is enabled).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant